function [sf] = getmainselection();
% get the selection in the main window
sf = 0;
htag = findobj('Tag', 'CTL');
sf = get(htag, 'Value');
if(sf <= 0)
   sf = 0;
end;
mn=get(htag, 'Min');
mx=get(htag, 'Max');
if (mn == mx)
   sf = 0;
   return;
end;
